<?php
declare(strict_types=1);
namespace App\One;
use App\Controller;
use Field\OneCampaignGroupConst;

// hook controller_one_search_campaign_group_use.php

/**
 * @title   计划组
 * @auth    true
 * @login   true
 * @menu    false
 * @component   vlist/index.vue
 * @icon    el-icon-menu
 * @active  true
 * @affix   false
 * @rank    99
 */
class Creative extends Controller
{
    // hook controller_one_search_campaign_group_public_start.php



    // hook controller_one_search_campaign_group_public_end.php

    /**
     * @title  下发配置
     * @rank    0
     */
    public function action_Conf_PUT()
    {
        // hook controller_one_search_campaign_group_conf_start.php
        $conf=['groupTotalRow'=>'bottom','grandTotalRow'=>'bottom','pageSize'=>10000,'remoteSort'=>0,'remoteFilter'=>0,'remoteSummary'=>0,'hidePagination'=>1,'hideRefresh'=>0,'hideDo'=>0,'add'=>0,'start'=>0,'stop'=>0,'delete'=>0,'import'=>0,'export'=>0,'pageSizes'=>[10,20,25,50,100,500,1000,10000],'TreeData'=>0,'Local'=>1,'enable'=>0,'disable'=>0,'chartRange'=>0,'copy'=>0,
            'merge'=>[
                'CampaignGroup'=>['k'=>'campaignGroupId','v'=>'campaignGroupName'],
                'Campaign'=>['k'=>'campaignId','v'=>'campaignName'],
            ]];
        $Columns = [
            ['prop' => 'campaignGroupName', 'label' => '计划组', 'hidden' => 0, 'sortable' => 1,'valueGetter'=>'colDef.context.CONFIG.CampaignGroup[node.data["campaignGroupId"]]'],
            ['prop' => 'campaignName', 'label' => '计划', 'hidden' => 0, 'sortable' => 1,'valueGetter'=>'colDef.context.CONFIG.Campaign[node.data["campaignId"]]'],
            ['prop'=>'campaignGroupId','label'=>'计划组ID','hidden'=>0,'sortable'=>1],
            ['prop'=>'campaignId','label'=>'计划ID','hidden'=>0,'sortable'=>1],
            ['prop'=>'adgroupId','label'=>'主体ID','hidden'=>1,'sortable'=>1],
            ['prop'=>'adgroupName','label'=>'主体','hidden'=>0,'sortable'=>1,'pinned'=>'left'],
            ['prop'=>'adRotation','label'=>'投放方式','hidden'=>1,'sortable'=>1,'width'=>100,],
        ];
        array_push($Columns,...$this->public_columns) ;
        $Filter = [];
        $Tools = [];

        // hook controller_one_search_campaign_group_conf_end.php
        $this->response('0000', ['Conf' =>$conf, 'Filter' => $Filter, 'Tools' =>$Tools, 'Columns' => $Columns]);
    }

    // hook controller_one_search_campaign_group_end.php
}

?>